
enum AHTXX_LIST {
    //% block="AHT2X"
     AHT2x_SENSOR,
    //% block="AHT1X"
     AHT1x_SENSOR
}

enum FUN_LIST {
    //% block="湿度(%rh)"
     readHumidity,
    //% block="温度(℃)"
     readTemperature
}



//% color="#5ba55b" iconWidth=50 iconHeight=40
namespace AGS10_Sensor { 

    //% block="读取数字TVOC传感器（AGS10）" blockType="reporter"
     export function read_ahtxx(parameter: any, block: any) {
        Generator.addInclude('#include_RL_AGS10_h>', '#include <RL_AGS10.h>');
        Generator.addInclude('#include_Wire_h', '#include <Wire.h>');
        Generator.addInclude('#include_Arduino_h', '#include <Arduino.h>');
        Generator.addObject(`AGS10_sensor`, `AGS10 `, `sensor = AGS10();`);
        Generator.addSetup(`sensor_begin`, `sensor.begin();`);
        Generator.addCode(`sensor.readTVOC()`);
    }

   
}
